package com.example.usermanagement.config;

import com.example.usermanagement.Interceptor.AuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import java.util.List;

/**
 * @author yha
 * @ClassName
 * @description:TODO
 * @date 2024年09月10日
 * @version: 1.0.0
 */
@Configuration
public class MvcConfiguration extends WebMvcConfigurationSupport {

    @Value("${liuka.mvc.url}")
    private List<String> urls;




    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //配置拦截器
        registry.addInterceptor(new AuthInterceptor()).addPathPatterns(urls);
    }

}
